'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const db = uniCloud.database();
		var id = await db.collection('users').add({
			username:event.username,
			password:event.password,
		})
		if(id){
			return{
				code:200,
				msg:"注册完成"
			}
		}else{
			return{
				code:501,
				msg:"注册失败"
			}
		}
		//返回数据给客户端
		return event
	};
